package cn.netbox.spring.pojo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
@Component("wxyStudent")
public class WXYStudent extends Student {
    @Value("${wxyName}")
    private String name;
    // 直接写在属性上面
    @Value("${wxyId}")
    private int id;
    @Autowired
    @Qualifier("wxyHome")
    private WXYHome wxyHome;
    @Autowired
    private WXYSchool wxySchool;

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int getId() {
        return id;
    }

    @Override
    public void setId(int id) {
        this.id = id;
    }

    public WXYHome getWxyHome() {
        return wxyHome;
    }

    public void setWxyHome(WXYHome wxyHome) {
        this.wxyHome = wxyHome;
    }

    public WXYSchool getWxySchool() {
        return wxySchool;
    }

    public void setWxySchool(WXYSchool wxySchool) {
        this.wxySchool = wxySchool;
    }

    @Override
    public String toString() {
        return "WXYStudent{" +
                "name='" + name + '\'' +
                ", id=" + id +
                ", wxyHome=" + wxyHome +
                ", wxySchool=" + wxySchool +
                '}';
    }
}
